package com.first.homeqian.controller;

import com.first.common.pojo.TbBottomArticle;
import com.first.common.vo.Result;
import com.first.homeqian.service.OrderService;
import com.first.homeqian.service.BottomArticleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-06-01 16:41
 **/
@RestController
@RequestMapping("home/qian/bottomArticle")
@Api(tags = "底部文章接口")
public class BottomArticleController {
    @Autowired
    private OrderService orderService;
    @Autowired
    private BottomArticleService qianBottomArticleService;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @GetMapping("getQianAllBottomArticle")
    @ApiOperation(value = "查询所有底部文章")
    public Result AllBottomArticle() {
        //System.out.println(userVo);
        List<TbBottomArticle> list= qianBottomArticleService.AllBottomArticle();
        return Result.success(list);
    }

//    String homeToken = request.getHeader("homeToken");
//    String s = redisTemplate.opsForValue().get("home::" + homeToken);
//    TbMember tbMember = JSON.parseObject(s, TbMember.class);
//        assert tbMember != null;
//    String mobile = tbMember.getMobile();
//    List<Order> all = orderService.findAll(mobile);
//        System.out.println(mobile);
//        return Result.success(all);
}
